package com.hd.trans.utils;

import com.hd.trans.R;
import com.hd.trans.network.PreferenceMgr;
import com.hd.trans.network.TranslatePreference;
import com.hd.trans.ui.base.AppContextProvider;

public class VoicePlaySettingUtil {
    public static String SPLIT_STR = "&";

    public static String[] getVoiceAnchor(String lang){
        if(lang.equals("zh-CN")){
            return PreferenceMgr.getInstance().getTranslatePreference().getVoiceCNTag().split(SPLIT_STR);

        }else if(lang.equals("en-GB")){
            return PreferenceMgr.getInstance().getTranslatePreference().getVoiceFLTag().split(SPLIT_STR);
        }else {
            return PreferenceMgr.getInstance().getTranslatePreference().getVoiceGender().split(SPLIT_STR);
        }
    }


    public static String getVoiceGender(int index){
        if(index == 0)
            return TranslatePreference.Default.VOICE_GENDER+"&"+ AppContextProvider.getContext().getResources().getString(R.string.female_voice);
        else
            return "ar-SA-Naayf&1&"+ AppContextProvider.getContext().getResources().getString(R.string.male_voice);
    }

    public static String getVoiceENTag(int index){
        if(index == 0)
            return TranslatePreference.Default.VOICE_FL_TAG+"&"+ AppContextProvider.getContext().getResources().getString(R.string.female_voice);
        else
            return "William&1&"+ AppContextProvider.getContext().getResources().getString(R.string.male_voice);
    }

    public static String getVoiceCNTag(int index){
        if(index == 0){
            //xiaotongfa&0
            return "Sitong&2&"+ AppContextProvider.getContext().getResources().getString(R.string.standard_female_voice);
        }else if(index == 1){
            return TranslatePreference.Default.VOICE_CN_TAG+"&"+ AppContextProvider.getContext().getResources().getString(R.string.energetic_female_voice);
        }else {
            return "Aida&1&"+ AppContextProvider.getContext().getResources().getString(R.string.steady_male_voice);
        }
    }
}
